﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

#nullable disable

namespace T4.Console.Db.Models
{
    [Table("Sys_RoleModule")]
    [Index(nameof(RoleId), nameof(ModuleId), Name = "AK_KEY_2_Sys_RoleModule", IsUnique = true)]
    [Index(nameof(RoleId), Name = "Index_RoleId")]
    public partial class Sys_RoleModule
    {
        [Key]
        [StringLength(36)]
        public string Id { get; set; }
        [Required]
        [StringLength(36)]
        public string RoleId { get; set; }
        [Required]
        [StringLength(36)]
        public string ModuleId { get; set; }
        [StringLength(36)]
        public string CreatedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? CreatedTime { get; set; }
        [StringLength(36)]
        public string LastModifiedBy { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime? LastModifiedTime { get; set; }

        [ForeignKey(nameof(ModuleId))]
        [InverseProperty(nameof(Sys_Module.Sys_RoleModules))]
        public virtual Sys_Module Module { get; set; }
        [ForeignKey(nameof(RoleId))]
        [InverseProperty(nameof(Sys_Role.Sys_RoleModules))]
        public virtual Sys_Role Role { get; set; }
    }
}
